﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace SharedGenomics.Domain
{
    [DataContract]
    public class OrdinalFileSchemaColumn : NominalFileSchemaColumn
    {
        public OrdinalFileSchemaColumn()
            : base(ColumnDistribution.Ordinal)
        {
        }

        public override IEnumerable<Nominal> Values
        {
            get { return base.Values.OrderBy(n => n.Value); }
        }

        [OnDeserializing]
        internal void OnDeserialising(StreamingContext context)
        {
            this.Initialize();
        }

        public override bool IsValidPhenotypeColumn
        {
            //ordinal columns cannot be phenotypes even if they happen to contain binary data - this may need to change?
            get { return false; }
        }
    }
}
